/* gisl: Gentoo init.d script launcher
 * By David GUGLIELMI <david.guglielmi@gmail.com>
 * Idea from Samuel SALSON <samuel.salson@zalteam.com>
 *
 * gisl is a free software distribued as-is .
 */

#include <cstdlib>
#include <iostream>
#include <sstream>

int
main (int argc, char *argv[])
{

  if (argc < 3)
   {
    std::cout << "Usage: gisl SERVICE OPTION [FLAGS]..." << std::endl;
    return EXIT_FAILURE;
   }

  std::stringstream s_str;
  
  s_str << "/etc/init.d/" << argv[1];

  for (int i = 2; i < argc; i++)
    s_str << " " << argv[i];

  std::system (s_str.str ().c_str ());

  return EXIT_SUCCESS;

}

